<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ include file="../../common/common.jsp" %>
<%@ include file="master_pass.jsp" %>
<HTML>
<HEAD>
<title>修改密码</title>
<%@ include file="../../common/meta.inc" %>
<link href="css.css" rel="stylesheet" type="text/css">
<base target="_self">
<SCRIPT LANGUAGE="javascript" SRC="${pageContext.request.contextPath}/scripts/common-validator.js"></SCRIPT>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/prototype.js"></script>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/buffalo/buffalo.js"></script>
<script language="javascript">
var END_POINT="${pageContext.request.contextPath}/buffalo";
var buffalo = new Buffalo(END_POINT);
function doSubmit() {

	form = document.theform;
	
	if(!validateForm(form))
		return;

	var password=$F('password');
	var masterId=<%=Utility.parseInt(request.getParameter("masterId"))%>;
	
    buffalo.remoteCall("masterServiceAjaxService.updatePassword",[password,masterId], function(reply) {
        ajaxSubmit(reply.getResult(),"","close");;	
    });
}

function validateForm(form)
{
    if(!sl_check(form.password,"新密码",50,1)) return false;
    return sl_confirmUpdate();
}
</script>
</HEAD>
<BODY leftMargin=0 topMargin=0 rightmargin="0" bottommargin="0" onkeydown="javascript:chachEsc(window.event.keyCode)">
<form name="theform" method="post" action="master_update_pass.jsp">
						<table border="0" width="100%" cellspacing="3">	
							<tr>
								<td width="46%" align="right">新密码:</td>
								<td width="49%"><input type="text" name="password" id="password" onkeydown="javascript:nextKeyPress(this)" size="20"></td>
							</tr>																																				
						</table>
</form>						
<table border="0" width="100%">
	<tr>
		<td align="right">
			<button class="btn" accessKey=s id="btnSave" name="btnSave" onclick="javascript:doSubmit();">保存(<u>S</u>)</button>
			&nbsp;&nbsp;
			<button class="btn" accessKey=c id="btnCancel" name="btnCancel" onclick="javascript:window.returnValue=null;window.close();">取消(<u>C</u>)</button>
			&nbsp;&nbsp;								
		</td>
	</tr>
</table>
</BODY>
</HTML>

